package com.example.jsruntimedemo.js.view;

import android.content.Context;
import android.view.View;

import com.example.jsruntimedemo.js.dom.DomElement;

public abstract class JsView<V extends View, D extends DomElement> {
    protected D mDomElement;
    protected V mNativeView;

    public void setDomElement(D domElement) {
        this.mDomElement = domElement;
    }

    public abstract String getType();

    public abstract V createViewInternal(Context context);

    public V createView(Context context) {
        V view = createViewInternal(context);
        mNativeView = view;
        return view;
    }
}
